package com.fortune.dao;

import com.fortune.dto.in.dStoreDeficit.DStoreDeficitAddDto;
import com.fortune.dto.in.dStoreDeficit.DStoreDeficitEditDto;
import com.fortune.dto.in.dStoreDeficit.DStoreDeficitInfoDto;
import com.fortune.dto.in.dStoreDeficit.DStoreDeficitListDto;
import com.fortune.dto.in.mStoreDeficit.MStoreDeficitListDto;
import com.fortune.vo.dStoreDeficit.DStoreDeficitInfo;
import com.fortune.vo.dStoreDeficit.DStoreDeficitInfoDetail;
import com.fortune.vo.dStoreDeficit.DStoreDeficitInfoList;
import com.fortune.vo.mStoreDeficit.StockDetailDeficit;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface DStoreDeficitDao {

    int findNumIsNull(@Param("num")String num);

    /**
     * 新增报亏单base
     * @param companyId
     * @param uuid
     * @param uid
     * @param addDto
     * @return
     */
    int addDeficitBase(@Param("dealerId") String dealerId, @Param("uuid") String uuid, @Param("uid") String uid, @Param("addDto") DStoreDeficitAddDto addDto);

    /**
     * 新增报亏单商品
     * @param companyId
     * @param uuid
     * @param infoDto
     * @return
     */
    int addDeficitDetail(@Param("companyId")String companyId,@Param("dealerId") String dealerId, @Param("uuid") String uuid, @Param("infoDto") DStoreDeficitInfoDto infoDto);

    /**
     * 查询报亏列表
     * @param companyId
     * @return
     */
    List<DStoreDeficitInfo> findDeficitList( @Param("dealerId")String dealerId, @Param("dStoreDeficitListDto") DStoreDeficitListDto dStoreDeficitListDto);


    /**
     * 查询报亏列表数量
     * @param companyId
     * @param dStoreDeficitListDto
     * @return
     */
    int findDealerDeficitListCount(@Param("dealerId")String dealerId, @Param("dStoreDeficitListDto") DStoreDeficitListDto dStoreDeficitListDto);


    /**
     * 查询报亏商品详情
     * @param companyId
     * @param deficitId
     * @return
     */
    DStoreDeficitInfoDetail findDealerDeficitInfo(@Param("dealerId")String dealerId, @Param("deficitId") String deficitId);

    DStoreDeficitInfoList findJXSname(@Param("mid")String mid);

    DStoreDeficitInfoList findJXSnames(@Param("did")String did,@Param("proId")String proId);
    /**
     * 确认报亏
     * @param companyId
     * @param dealerId
     * @param uuid
     * @return
     */
    int editDStoreDeficitConfirm(@Param("dealerId")String dealerId,@Param("operatorId")String operatorId, @Param("uuid") String uuid);

    /**
     * 删除
     * @param companyId
     * @param dealerId
     * @param uuid
     * @return
     */
    int deleteDStoreDeficit(@Param("dealerId")String dealerId, @Param("uuid") String uuid);

    /**
     * 删除商品详情
     * @param companyId
     * @param dealerId
     * @param uuid
     * @return
     */
    int deleteInfo(@Param("dealerId")String dealerId, @Param("uuid") String uuid);

    /**
     * 编辑报亏单base
     * @param companyId
     * @param editDto
     * @return
     */
    int editDeficitBase(@Param("dealerId") String dealerId, @Param("editDto") DStoreDeficitEditDto editDto);

    DStoreDeficitAddDto findData(@Param("did")String did,@Param("id")String id);

    StockDetailDeficit findProductStock(@Param("did")String did, @Param("storeId")String storeId, @Param("proId")String proId,@Param("mid")String mid);

    int addProDuctStock(@Param("did")String did, @Param("storeId")String storeId, @Param("proId")String proId, @Param("no")int no, @Param("id")String id, @Param("sNo")int sNo, @Param("num")BigDecimal num, @Param("rainNum")float rainNum,@Param("mid")String mid);

}
